<!-- 新闻详情列表 -->
<template>
  <el-form :data="newsInfo" label-position="right" label-width="80px" border>
    <el-form-item label="新闻编号">
      <el-input v-model="newsInfo.newsId" disabled/>
    </el-form-item>
    <el-form-item label="新闻封面">
      <el-image :src="baseImagePath+newsInfo.cover" style="height: 100px"/>
    </el-form-item>
    <el-form-item label="新闻标题">
      <el-input v-model="newsInfo.title" disabled/>
    </el-form-item>
    <el-form-item label="新闻简介">
      <el-input type="textarea" v-model="newsInfo.introduction" disabled/>
    </el-form-item>
    <el-form-item label="新闻内容">
      <el-input type="textarea" v-model="newsInfo.content" :autosize="{ minRows: 2, maxRows: 4}" disabled/>
    </el-form-item>
    <el-form-item label="作者">
      <el-input v-model="newsInfo.author" disabled/>
    </el-form-item>
    <el-form-item label="发布日期">
      <el-input v-model="newsInfo.releaseDate" disabled/>
    </el-form-item>
  </el-form>
</template>

<script>
export default {
  name: 'newsInfo',
  data () {
    return {
      loading: false,
      newsInfo: {},
      baseImagePath: process.env.VUE_APP_BASE_API + '/img/'
    }
  },
  methods: {
    init (newsId) {
      this.$http.get(`/sys/news/info/${newsId}`).then(({ data }) => {
        if (data.code === 200) {
          this.newsInfo = { ...data.data.news }
        }
      })
    }
  },
  created () {
    this.$nextTick(() => {
      this.init()
    })
  }
}
</script>

<style scoped lang="scss">

</style>
